#ifndef QAPPDEBUGWIN_H
#define QAPPDEBUGWIN_H

#include <QWidget>
#include <QTextEdit>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QTabWidget>
#include <QPushButton>
#include <QLabel>
#include <QLineEdit>
#include <QNetworkAccessManager>
#include "QAppDebugTextEdit.h"

class QAppDebugWin : public QWidget
{
	Q_OBJECT

public:
        QAppDebugWin(QWidget *parent);
        ~QAppDebugWin();

	void printDebugMsg(QString debugMsg);

signals:
        void winDestroyed(QAppDebugWin* pWin);
public slots:
        void on_debugMsg_incoming(QtMsgType type,QString sentence);

protected:
	void closeEvent(QCloseEvent *event);

private:
	void createUI();
	void printFilteredDebugMsg(QString debugMsg);

private slots:
	void clearAllMsg();
	void clearFilteredMsg();
	void openLink(QString& url);
	void dataArrived(QByteArray& data);

private:
	QHBoxLayout   *m_pBgLayout;
	QVBoxLayout   *m_pAllLayout;
	QVBoxLayout   *m_pFilteredLayout;
	QHBoxLayout   *m_pFilteredOpLayout;
        QLabel       *m_pFilterTitle;
        QLineEdit   *m_pFilterText;
        QWidget     *m_pAllParent;
        QWidget     *m_pFilteredParent;
        QPushButton *m_pAllClearBtn;
        QPushButton *m_pFilteredClearBtn;
        QAppDebugTextEdit   *m_pAllTextEdit;
        QAppDebugTextEdit   *m_pFilteredTextEdit;
        QTextEdit           *m_pUrlDataTextEdit;
        QTabWidget  *m_pTabWidget;
	long           m_times;
	
};

#endif // QAPPDEBUGWIN_H


